<template>
    <h2>用户信息列表展示</h2>
    <table class="table-bordered" border="1">
        <thead>
        <tr>
            <td>用户名</td>
            <td>用户密码</td>
            <td>用户注册时间</td>
        </tr>
    </thead>
    <tbody>
        <tr v-for="user in users">
            <td>{{ user.UserName }}</td>
            <td>{{ user.UserPwd.substring(0,4)+'*****' }}</td>
            <td>{{ user.UserDate.substring(0,10) }}</td>
        </tr>
    </tbody>
    </table>
    
    
    </template>
    
    
    <script setup lang="ts">
    import axios from 'axios';
    import { ref,onMounted} from 'vue';  

    
    onMounted(()=>{
        Show();
    })
    const users = ref([{
        UserName:"",
        UserPwd:"",
        UserDate:''
    }])

    const Show = ()=>{
         axios.get("http://localhost:61413/api/User/UserShow",{
            params:{
            }
         })
         .then((res)=>{
            users.value=res.data;
         })
         .catch((err)=>{
            console.log(err);
         })
    }
    </script>